package com.kwedding.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.kwedding.dto.app.RequestScheduleListByMonth;
import com.kwedding.dto.app.ResponseScheduleList;
import com.kwedding.service.app.SchduleService;
import com.kwedding.util.BackJson;
import com.kwedding.util.JsonBackBase;
import com.kwedding.util.LoggerParent;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Controller
@RequestMapping("/rest/schedule")
@Api(tags = "APP档期")
public class ScheduleController extends LoggerParent {

	@Autowired
	private SchduleService schduleService;

	@ApiOperation("根据月份获取档期信息")
	@ResponseBody
	@RequestMapping(value = "getScheduleList", method = { RequestMethod.POST })
	private JsonBackBase<List<ResponseScheduleList>> getScheduleList(
			@RequestBody RequestScheduleListByMonth listByMonth) {
		return BackJson.successObj(schduleService.getScheduleList(listByMonth));
	}
}
